package com.company.test16;

import javax.swing.*;
import java.awt.event.*;
import java.util.jar.JarFile;

/**
 * Created by Administrator on 2016.6.19.
 */
public class Test16_07 extends JFrame{
    public static void main(String[] args){
        Test16_07 frame=new Test16_07();
        frame.pack();
        frame.setTitle("Only a test");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

    public Test16_07(){
        ;addWindowListener(new WindowListener(){

            @Override
            public void windowDeiconified(WindowEvent e) {
                System.out.println("Window deiconified");
            }

            @Override
            public void windowIconified(WindowEvent e) {
                System.out.println("Window iconified");
            }

            @Override
            public void windowActivated(WindowEvent e) {
                System.out.println("Window activate");
            }

            @Override
            public void windowDeactivated(WindowEvent e) {
                System.out.println("Window deactivated");
            }

            @Override
            public void windowOpened(WindowEvent e) {
                System.out.println("Window opened");
            }

            @Override
            public void windowClosing(WindowEvent e) {
                System.out.println("Window closing");
            }

            @Override
            public void windowClosed(WindowEvent e) {
                System.out.println("Window closed");
            }
        });
    }

}
